home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13718 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: quanta.com!rsww
  2. From: rsww@quanta.com (Ross S. W. Walker)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Settle a bet please
  5. Date: 9 Apr 1996 21:56:18 GMT
  6. Organization: Quanta Communications, Inc.
  7. Distribution: inet
  8. Message-ID: <4keme2$h8t@quasar.quanta.com>
  9. References: <4jfopb$o9n@news1.sympatico.ca> <Dp11Bx.2o7@watserv3.uwaterloo.ca> <4k41v6$60v@niamh.indigo.ie> <4k4d7u$rhk@solutions.solon.com> <4kbipq$k23@airdmhor.gen.nz>
  10. NNTP-Posting-Host: quanta.quanta.com
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Simon Hosie (gumboot@airdmhor.gen.nz) wrote:
  14. : In article <4k41v6$60v@niamh.indigo.ie>, Niall Smart <nsmart@indigo.ie> wrote:
  15. : >   int i; char Name[7] = "My Name";
  16. : >   char More[]  = "AAAAAAA";
  17.  
  18. : Peter Seebach:
  19. : > There is no "char *More[]" here, and the contents of both Name and More are
  20. : > writable, because they are arrays of non-const.  What is most likely
  21. : > causing them not to be adjacent on some machines is a spare byte of
  22. : > padding to keep everything word-aligned.  This is not a language feature,
  23. : > just a likely explanation.
  24.  
  25. :   Another possibility is that they're ordered backwards in memory.  I don't
  26. : know why, but I've seen it happen - actually I do know why, it's because I
  27. : looked.  I don't know why the compiler did it.
  28.  
  29. Maybe during the part of the compiler pass for variable allocation it was
  30. traversing up the tree?
  31.  
  32.  
  33. Cheers,
  34.  
  35. Ross Walker
  36.  
  37.